package com.ylr.user.framework.feign.user;

import com.ylr.user.framework.feign.configuration.YuUserClientConfig;
import com.ylr.user.framework.feign.fallback.YuUserClientFallback;
import com.ylr.base.common.po.user.UserPo;
import com.ylr.base.common.tool.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2023-05-04 11:24:58
 * className: YuUserClient
 * version: 1.0
 * description:
 */
@FeignClient(value = "ylr-user", path = "/api/user", fallback = YuUserClientFallback.class,
        configuration = YuUserClientConfig.class)
public interface YuUserClient {

    /**
     * 用户权限校验接口
     * @param userId  用户主键
     * @param channel 所属渠道
     * @param uri     接口路径
     * @return 校验结果[true-通过 false-拒绝]
     */
    @GetMapping("/auth")
    Result<UserPo> check(@RequestParam("userId") String userId, @RequestParam("channel") String channel,
                         @RequestParam("uri") String uri);

}
